import { SM4 } from 'gm-crypto'

//加密KEY值(后台提供保持一致)
const strKey = "e6c0c643d7c34e1e8c15006e147f9f77";

//加密
export const Sm4encrypt = (data) => {
	return SM4.encrypt(data.toString(), strKey, {
		inputEncoding: 'utf8',
		outputEncoding: 'base64'
	}).toString();
}

//sm4解密
export const Sm4Dncrypt = (data) => {
	return SM4.decrypt(data.toString(), strKey, {
		inputEncoding: 'base64',
		outputEncoding: 'utf8'
	}).toString();
}





